const router = require('koa-router')()
const db = require('../db')
const {logger} = require('../utils/logger')
router.get('/index', async(ctx) => {
  // ctx.body = '你好'
  let sql = ''
  let value = ''
  await db.query(sql, value).then(res => {
    return ctx.body = 'hello world'
  }).catch((e) => {
    logger.error(e)
    ctx.body = 'error'
  })
})
router.get('/test', async (ctx) => {
  await ctx.render('index', {})
})
module.exports = router